{include file="insurant_common/insurant_head"}
    <!-- -nav -->

    <div class="wraper-box">
      <div class="container">
        <div class="main ovh">
          <div class="menu left">
            {include file="insurant_common/insurant_left"}
          </div>
          <div class="menu-content left">
            <div class="content-title">
              <p><span class="red name">填写相关资料</span></p>
            </div>
            <div class="step-box">
              <div class="active">设保留价</div>
              <div class="active">看货信息</div>
              <div class="">提货信息</div>
              <div class="">收款信息</div>
              <div class="">递交委托书</div>
            </div>
            <div class="form-box">
              <div class="form-content">
                <div class="form-item">
                  <label>看货要求:</label>
                  <input type="hidden" value="{$info.i_id | default=''}" id="i_id">
                  <input type="text" placeholder="请选择货品类别" id="look_type" value="{$info.look_type | default=''}" />
                </div>
                <div class="form-item">
                  <label>看货地址：</label>
                  <input type="text" placeholder="请选择省市区" id="address" name="address" class="address" value="{$info.province|default=''} {$info.city|default=''} {$info.town|default=''}"/>
                  <input type="text" placeholder="详细门牌地址" name="address_detail"  class="address-detail" value="{$info.address_detail | default = ''}"/>
                </div>
                <div class="form-item">
                  <label>联系人:</label>
                  <input type="text" placeholder="请填写联系人" name="linkman" value="{$info.linkman | default = ''}" />
                </div>
                <div class="form-item">
                  <label>手机号:</label>
                  <input type="text" placeholder="请填写手机号" name="phone" value="{$info.phone | default = ''}"/>
                </div>
                <div class="form-item">
                  <label style="width:100px">备用联系人手机号:</label>
                  <input type="text" placeholder="请填写备用联系人手机号" name="second_phone" value="{$info.second_phone | default = ''}" />
                </div>
              </div>
              <div class="form-footer">
                <div class="step-btn-box">
                    <div class="pre-btn" onclick="window.history.go(-1)">上一步</div>
                  <div class="next-btn" id="submit">下一步</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      {include file="common/footer"}
      <script src="/static/admin/layui/layui.js"></script>
      <script>
          layui.use(['layer'], function(){
              var layer = layui.layer;
              $('#submit').on('click',function(){
                  var i_id = $('#i_id').val();
                  var address = $('#address').val();
                  var look_type = $('#look_type').val();
                  var address_detail = $('input[name="address_detail"]').val();
                  var linkman = $('input[name="linkman"]').val();
                  var phone = $('input[name="phone"]').val();
                  var second_phone = $('input[name="second_phone"]').val();
                  if (address.length == 0) {
                      layer.msg('请选择省市区');
                      return;
                  }
                  if (look_type.length == 0) {
                        layer.msg('请选择看货要求');
                      return;
                  }
                  if (address_detail.length == 0) {
                        layer.msg('请填写详细门牌地址');
                      return;
                  }
                  if (linkman.length == 0) {
                        layer.msg('请填写姓名');
                      return;
                  }
                  if (phone.length == 0) {
                        layer.msg('请填写手机号');
                      return;
                  }
                  $.ajax({
                      url:'/pc/insurant/saveBolInfo',
                      type:'post',
                      dataType:'json',
                      data:{
                          'look_type':look_type,
                          'address':address,
                          'address_detail':address_detail,
                          'linkman':linkman,
                          'phone':phone,
                          'second_phone':second_phone,
                          'i_id':i_id,
                          'now_status':2,
                          'menu_id':2
                      },
                      success:function (data) {
                          if(data.code ==200){
                              window.location.href = '/pc/insurant/step_3?i_id='+i_id+'&menu_id=2';
                          }else{
                                layer.msg(data.msg);
                          }
                      }
                  });
              });

          });





      </script>